package com.zhyl.demo.service.impl;

import com.zhyl.demo.entity.Consultation;
import com.zhyl.demo.mapper.ConsultationMapper;
import com.zhyl.demo.service.ConsultationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @author yang3
 */
@Service
public class ConsultationServiceImpl implements ConsultationService {
    private final ConsultationMapper consultationMapper;
    @Autowired
    private ConsultationServiceImpl(ConsultationMapper consultationMapper)
    {
        this.consultationMapper = consultationMapper;
    }

    @Override
    public Boolean addConsultation(Consultation consultation) {
        Integer integer = consultationMapper.addConsultation(consultation);
        if (integer>0){
            return true;
        }else {
            return false;
        }
    }

    @Override
    public Consultation getConsultationDetail(Integer consultationId) {
        Consultation consultationDetail = consultationMapper.getConsultationDetail(consultationId);
        if (consultationDetail!=null){
            return consultationDetail;
        }else {
            return null;
        }
    }
}
